//path
const { log } = require('console');
const path = require('path')


console.log(path.resolve());//绝对路径

//relative返回相对路径
console.log(path.relative());//相对路径

//parse
console.log(path.parse(__filename));

//获取后缀
console.log(path.extname(__filename));

//normalize  规范路径
console.log(path.normalize('//a///b'));


//url

const url = require('url')

console.log(url);

//实例对象
// const obj = new url.URL('https://wap.baidu.com/')


//转换对象来使用  wd=luoli&name=abc

console.log(query.split('&'));

const arr = query.split('&').map(item =>{
    return item.split('=')
})

let obj = {}

arr.forEach(item => {
    obj[item[0]] = item[1]
});

console.log(obj);

//querystring  字符串模块  解析查询字符串

const querystring = require('querystring')

console.log(querystring.parse(query));
